<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>layui</title>
<META HTTP-EQUIV="pragma" CONTENT="no-cache"> 
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate"> 
<META HTTP-EQUIV="expires" CONTENT="0">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../../layui/css/layui.css" media="all">
<script src="../../../layui/layui/layui.js" charset="utf-8"></script>
<script src="../../../js/angular.js" charset="utf-8"></script>
<script src="../../../layui/jquery-3.2.1.min.js" charset="utf-8"></script>
<script type="text/javascript" src="../gjjhbj/fy.js"></script>
	<script type="text/javascript" src="../../../layui/lay/modules/layer.js"></script>

	<link rel="stylesheet" href="../../../css/font_eolqem241z66flxr.css" media="all" />
	<link rel="stylesheet" href="../../../css/news.css" media="all" />
	<script type="text/javascript" src="../../../layui/layui/GetPath.js"></script>
<body  class="childrenBody">
	<!-- 邮件发送 -->
	<div class="sysNotice col">
			<blockquote class="layui-elem-quote title">汇缴功能基础信息</blockquote>
			<table class="layui-table">
				<colgroup>
					<col width="10%"  style="min-width:100px">
					<col width="20%">
					<col width="10%" style="min-width:100px">
					<col  width="50%">
				</colgroup>
				<tbody>
					<tr>
						<td>缴存账号</td>
						<td style="text-align:left;padding-left:20px;"><b id="GJJJCZH" ></b></td>
						<td>单位代码</td>
						<td style="text-align:left;padding-left:20px;"><b id="DWDM"></b></td>
					</tr>
					<tr>
						<td>单位名称</td>
						<td style="text-align:left;padding-left:20px;"><b id="DWMC"></b></td>
						<td>缴存银行</td>
						<td style="text-align:left;padding-left:20px;"><b  id="JCYH"></b></td>
					</tr>	
					<tr>
						<td>银行代码</td>
						<td style="text-align:left;padding-left:20px;"><b id="YHDM"></b></td>
						<td>应缴金额</td>
						<td style="text-align:left;padding-left:20px;"><b id="YJ"></b></td>
					</tr>						
				</tbody>
			</table>
			<button class="layui-btn " id="sc">生成汇缴订单</button>
		</div>
<div class="layui-form links_list" ng-app="myApp" ng-controller="customersCtrl" align="center" >
		<div id="left" style="float:left;width:24%"">
		<Loading></Loading>
			<table class="layui-table" style="width:100%;">
					<tr align="center" style="background-color:#f1f1f1">
						<td ng-show=false>当前行数</td>
						<td>应缴年月</td>
						<td>应缴金额</td>
						<td>操作</td>
					</tr>
					<tr ng-repeat="x in names1" align="center">
						<td ng-if="$odd" ng-show=false style="background-color:#f1f1f1">{{
							$index+1 }}</td>
						<td ng-if="$even" ng-show=false>{{ $index+1 }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{
							x.JCNY }}</td>
						<td ng-if="$even">{{ x.JCNY }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1;text-align:right">{{ x.DWJCE| currency:"" 
							}}</td>
						<td ng-if="$even" style="text-align:right">{{ x.DWJCE| currency:""  }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1"><a
							style="color: red;" ng-click="ck($index)" href="#">查看明细</a>
							<a
							style="color: red;" ng-click="de($index)" href="#">删除</a>
						</td>
						<td ng-if="$even"><a
							style="color: red;" ng-click="ck($index)" href="#">查看明细</a>
							<a
							style="color: red;" ng-click="de($index)" href="#">删除</a>
						</td>
					</tr>
				</table>
		
		
		
		
				
		</div>
	
	<div id="right" style="float:left;width:76%">
	
	<table class="layui-table" style="width:100%">
					<tr align="center" style="background-color:#f1f1f1">
						<td ng-show=false>当前行数</td>
						<td>年月</td>
						<td>个人账号</td>
						<td>证件号码</td>
						<td>单位月缴存额</td>
						<td>个人月缴存额</td>
						<td>月缴存额</td>
						<td>单位账号</td>
<!-- 						<td>审核</td>
						<td>审核日期</td>
 -->						<td>性别</td>
						<td>姓名</td>

					</tr>
					<tr ng-repeat="y in names" align="center">
						<td ng-if="$odd" ng-show=false style="background-color:#f1f1f1">{{
							$indey+1 }}</td>
						<td ng-if="$even" ng-show=false>{{ $indey+1 }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{
							y.NIANYUE }}</td>
						<td ng-if="$even">{{ y.NIANYUE }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{ y.GRZH
							}}</td>
						<td ng-if="$even">{{ y.GRZH }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{ y.ZJHM
							}}</td>
						<td ng-if="$even">{{ y.ZJHM }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1;text-align:right;">{{ y.DWJCE| currency:""
							}}</td>
						<td ng-if="$even" style="text-align:right;">{{ y.DWJCE | currency:""}}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1;text-align:right;">{{ y.GRJCE| currency:""
							}}</td>
						<td ng-if="$even" style="text-align:right;">{{ y.GRJCE | currency:""}}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1;text-align:right;">{{ y.YJJE| currency:""
							}}</td>
						<td ng-if="$even" style="text-align:right;">{{ y.YJJE | currency:""}}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{ y.DWZH
							}}</td>
						<td ng-if="$even">{{ y.DWZH }}</td>
						<!-- <td ng-if="$odd" style="background-color:#f1f1f1">{{ y.SH
							}}</td>
						<td ng-if="$even">{{ y.SH }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{ y.SHRQ
							}}</td>
						<td ng-if="$even">{{ y.SHRQ }}</td> -->
						<td ng-if="$odd" style="background-color:#f1f1f1">{{ y.XB
							}}</td>
						<td ng-if="$even">{{ y.XB }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{ y.XM
							}}</td>
						<td ng-if="$even">{{ y.XM }}</td>
						
					</tr>
				</table>
					<div class="layui-btn-group">
				<button class="layui-btn layui-btn-primary layui-btn-sm"
					ng-click="Sy()">首页</button>
				<button class="layui-btn layui-btn-primary layui-btn-sm"
					ng-click="Previous()">上一页</button>
				<button ng-repeat="page in pageList"
					class="layui-btn layui-btn-primary layui-btn-sm "
					ng-click="selectPage(page)">{{page}}</button>
				<button class="layui-btn layui-btn-primary layui-btn-sm"
					ng-click="Next()">下一页</button>
				<button class="layui-btn layui-btn-primary layui-btn-sm"
					ng-click="Wy()">尾页</button>
				<button class="layui-btn layui-btn-primary layui-btn-sm ">{{selPage}}/{{pages}}</button>
			</div>
	</div>

</div>


	<!-- 		<table class="layui-hide" id="LAY_table_user" lay-filter="user"></table>   -->
	<script type="text/javascript" src="../../../js/log.js"></script>

	<script type="text/javascript">
	
	
	var app = angular.module('myApp', []);
	 app.directive('loading', function(){  
		        return {  
		            restrict: 'E',  
		            transclude: true,  
		            template: '<div ng-show="loading" class="loading" id="allDiv"  style="position:fixed; top:0px; left:0px; width:100%; height:100%; display:none; background-color:#000; opacity: 0.5; z-index:99999;">'  
		            +'<img alt="" src="../../../layui/layui/img/jz.gif" style="vertical-align: middle;width:30px; height:30px; position: absolute; top:50%; left:50%; margin-top: -50px; margin-left:-50px;"/>'
		            +'</div>',  
		            link: function (scope, element, attr) {  
		                scope.$watch('loading', function (val) {  
		                    if (val){  
		                        document.getElementById("allDiv").style.display = "block";  
		                    }else{  
		                        document.getElementById("allDiv").style.display = 'none';  
		  
		                    }  
		                });  
		            }  
		        };
		    }); 
	   app.controller('customersCtrl', function($scope, $http) {
	   $("#sc").hide();
	     $scope.setLoading =function(){  
			    if($scope.loading ==undefined || $scope.loading ==false){  
			        $scope.loading=true;  
			    }else{  
			        $scope.loading=false;  
			    };
			};
			 $scope.setLoading ();
	   $http({
							url:getPath()+"/wsyyt/hjgncontroller/test1",
							contentType:"text/html;charset=utf-8",
							method:'post'			
						})
					.then(function(res) {
					 if(res.data.msg==null)
								 {
								 	layer.msg("登陆失效请重新登陆");
									setTimeout(function () {
										window.top.location.href=res.data;
									}, 1500);
									return;
								 }
						$scope.setLoading();
									$scope.names1=res.data.data;
									if(res.data.msg=='成功'){
										$("#sc").hide();
										layer.alert('提示：已生成明细或已完成托收，无法再次生成明细', {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 5    // icon
								     ,btn2:function(){
										
								     }});	
									}
									else
										$("#sc").show();
										
									if($scope.names1.length>0&&$scope.names1!=null){
									var yj=Number("0");
									for(var i=0;i<$scope.names1.length;i++)
									{
										yj=Number(yj)+Number($scope.names1[i].DWJCE);
									}
									$("#YJ").html(yj);
										$("#sc").hide();
									}
					});
					
			
					 $scope.setLoading ();
	   		$http({
							url:getPath()+"/wsyyt/hjgncontroller/test",
							contentType:"text/html;charset=utf-8",
							method:'post'				
						})
					.then(function(res) {
						$scope.setLoading();
					});
					
					$scope.ck=function(index){
						$scope.setLoading();
						$http({
							url:getPath()+"/wsyyt/hjgncontroller/test2",
							params:{ID:$scope.names1[index].DWJJID,NY:$scope.names1[index].JCNY},
							contentType:"text/html;charset=utf-8",
							method:'post'				
						})
					.then(function(res) {
						$scope.names=res.data.data;
						$scope.setLoading();
						feny($scope.names);
					});
					
					};
					
						$scope.de=function(hs){
						layer.confirm('是否确认删除当前行明细?', {icon: 3, title:'提示'}, function(index){
  
  						layer.close(index);
						console.info($scope.names1);
						$scope.setLoading();
						$http({
							url:getPath()+"/wsyyt/hjgncontroller/test3",
							params:{ID:$scope.names1[hs].DWJJID,NY:$scope.names1[hs].JCNY},
							contentType:"text/html;charset=utf-8",
							method:'post'				
						})
					.then(function(res) {
						$scope.data=res.data.data;
						$scope.setLoading();
						 location.reload();
					});
					});
					
					}
	   
	   });
	</script>
	<script type="text/javascript" id="barDemo">
		function getPath() {
		    return 'http://'+location.host;
		};
	</script>
	
	<script>
		layui.use('layer', function(){
  var layer = layui.layer;
  
});  
</script>
<script type="text/javascript">
	$.ajax({
				url : getPath()+'/wsyyt/hjgncontroller/test',
				method : 'post',
				dataType : 'JSON',
				success : function(result) {
						var data = result.data;
						for(var t=0;t<data.length;t++)
						{
							if(data[t].DWDM!=""&&data[t].DWDM!=null)
							{
								$.each(data[t], function(key, value) {
								$("#" + key).html(value || "");
							});
						
							}
						}
				},

			});
		     function getPath() {  
	     
	        return 'http://'+location.host;
	}
$("#sc").click(function(){

 layer.open({
		                    type: 2,
		                    title: '缴存托收确认',
		                    shadeClose: true,
		                    shade: false,
		                    maxmin: true, //开启最大化最小化按钮
		                    area: ['90%', '90%'],
		                    content: getPath()+'/wsyyt/dwwsyyt/dw/gjjhbj/jctsqr.html'
		                });
		});
			
	</script>

</body>
</html>